import numpy as np
import pandas as pd
from scipy import signal

inp = np.array([[64,63,62,61,60,59,58,57],[56,55,54,53,52,51,50,49],[48,47,46,45,44,43,42,41],[40,39,38,37,36,35,34,33,],[32,31,30,29,28,27,26,25], [24,23,22,21,20,19,18,17],[16,15,14,13,12,11,10,9], [8,7,6,5,4,3,2,1]])
#inp = np.array([[16,15,13,12], [11,10,9,8], [7,6,5,4], [4,3,2,1]])
print("inp:", inp)

kernel = np.array([[1,1,1],[1,1,1],[1,1,1]])
print("kernel:", kernel)

convolution_full_result = signal.convolve2d(inp, kernel, mode='full')
print("convolution full  result:\n", convolution_full_result)

convolution_full_result = signal.convolve2d(inp, kernel, mode='same')
print("convolution same  result:\n", convolution_full_result)

convolution_full_result = signal.convolve2d(inp, kernel, mode='valid')
print("convolution valid  result:\n", convolution_full_result)

'''
arr = np.arange(64).reshape(8, 8)
print(arr)
df1 = pd.DataFrame(arr)
print(df1)
print()
'''
